/**
 * 
 */
package com.morningstar.qs.api.basic.common.data;

/**
 * @author rzeng
 *	@deprecated
 */
public enum ExchangeDataServiceType {
	DELAY ("D"),
	REALTIME ("R"),
	BATS ("B");
	
    private final String value;

    private ExchangeDataServiceType(String value) {
        this.value = value;
    }
    
    public String getValue() {
        return value;
    }
    
    public static ExchangeDataServiceType getType(String value) {
    	ExchangeDataServiceType type = DELAY;
    	if (null != value) {
    		if (value.trim().equals(DELAY.getValue())) {
    			type = DELAY;
    		}
    		if (value.trim().equals(REALTIME.getValue())) {
    			type = REALTIME;
    		}
    		if (value.trim().equals(BATS.getValue())) {
    			type = BATS;
    		}
    	}
    	return type;
    }
    
    public static ExchangeDataServiceType getType(int value) {
    	ExchangeDataServiceType type = null;
    	switch (value) {
		case 1:
			type = REALTIME;
			break;		
		default:
			type = DELAY;
			break;
		}
    	return type;
    }
}
